package com.binhai.dept;

import com.binhai.rolem.RoleBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RequestMapping("/dept")
@RestController
public class deptController {
    @Autowired
   private deptServiceImpl  deptService;
    @RequestMapping("/getAllDepts.do")
    public List<dept> getAllInfos(){
        return deptService.getAllInfos();
    }
    //添加部门信息
    @RequestMapping("/addDept.do")
    public Map saveInfo( dept dept1){
     return  deptService.addDept(dept1);
    }
    //删除部门信息
    @RequestMapping("/deleteDept.do")
    public Map deleteInfo(int id){
        return deptService.deleteInfo(id);
    }
    //根据id查询部门信息
    @RequestMapping("/getDeptById.do")
    public dept getInfoById(int id){
        return deptService.getInfoById(id);
    }

    //修改部门信息
    @RequestMapping("/updateDept.do")
    public Map updateInfo(dept dept){
        return deptService.updateInfo(dept);
    }
    //条件查询
    @RequestMapping("/searchDept.do")
    public List<dept> selectByWhere(String name, String manager) {
        return deptService.selectByWhere(name, manager);
    }
}
